import { useMyStore } from "@/stores/loginStore";
import {ref} from 'vue';
export const easyuseData=()=>
    {
       const CodeStore =useMyStore();
       const newCode=ref('');
       const newPassword=ref('');
       const show=ref(false);
       const toWelcome = () => {
        console.log('welcome');
        
        uni.navigateTo({
          url: '/pages/identify/identify'
        })
      }
       const saveCode=(newCode:string)=>
        {
            CodeStore.addCode(newCode);
        console.log(newCode)
        }
        const savePassword=(newPassword:string)=>
            {
                CodeStore.addPassword(newPassword)
            console.log(newPassword)
            }
            const isShow=()=>
                {
                    show.value=!show.value,
                    console.log(show.value)
                }
       return {CodeStore,newCode,newPassword ,saveCode,savePassword
        ,isShow,show,toWelcome
       }
    }